<%@ page import="com.bw.pojo.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Aaking-aline
  Date: 2022-05-09
  Time: 9:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>信息展示页</title>

        <style>
            table,th,tr,td{
                border: aquamarine 3px solid;
            }
        </style>

    </head>
    <body>
        <%
            List<Student> list = (List<Student>)request.getAttribute("list");
            if(list == null){
                response.sendRedirect("SelectAllStudentServlet");
                return ;
            }
        %>

        <center>
            <table>
                <tr>
                    <td>Id</td>
                    <td>name</td>
                    <td>age</td>
                    <td>birth</td>
                </tr>

                <% for (Student stu : list) { %>
                        <tr>
                            <td><%=stu.getId()%></td>
                            <td><%=stu.getName()%></td>
                            <td><%=stu.getAge()%></td>
                            <td><%=stu.getBirth().toString()%></td>
                        </tr>
                <% } %>


            </table>
        </center>



    </body>
</html>
